package io.plantrader;

import static org.assertj.core.api.Assertions.assertThat;
import org.openqa.selenium.WebDriver;
import io.github.bonigarcia.wdm.WebDriverManager;

/**
 * 环境:浏览器运行在本地
 * 测试:打开百度首页，验证标题是否包含“百度”
 */
public class ChromeInLocal {
    public static void main(String[] args) {
        // 启动容器
        WebDriverManager webDriverManager = WebDriverManager.chromedriver();
        // 创建 WebDriver 对象
        WebDriver driver = webDriverManager.create();
        // 加载网页
        driver.get("https://www.baidu.com/");
        // 验证标题
        assertThat(driver.getTitle()).contains("百度");
        
        // 关闭浏览器
        webDriverManager.quit();
    }
}
